//
//  HotViewController.m
//  WE
//
//  Created by 要帅气的生活 on 15/11/20.
//  Copyright © 2015年 UNOHACHA. All rights reserved.
//

#import "HotViewController.h"
#import "FiveCell.h"
#import "Size.h"
#import "InformationForDetailsViewController.h"
@interface HotViewController ()<UITableViewDataSource,UITableViewDelegate>

@property (nonatomic,strong) UITableView *table;
@end

@implementation HotViewController
- (void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden = NO;
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"热门资讯";
    _table = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, WindowWidth, WindowHeight)];
    [self.view addSubview:_table];
    _table.dataSource = self;
    _table.delegate = self;
    _table.showsVerticalScrollIndicator = NO;
    [_table registerClass:[FiveCell class] forCellReuseIdentifier:@"hot"];
    _table.rowHeight = 100;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    FiveCell *cell = [tableView dequeueReusableCellWithIdentifier:@"hot"];
    cell.title.text = @"上班族如何打好冬季“保胃战”?";
    cell.neirong.text = @"冬季是胃病的高发期，到医院里可以发现，求诊的患者中，年轻的的上班族几乎占了一半";
    cell.img.image = [UIImage imageNamed:@"shouye4"];
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    [self.navigationController pushViewController:[[InformationForDetailsViewController alloc] init] animated:YES];
    
    NSLog(@"666");
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
